
import numpy as np


def decimal_to_binary_list(n):
    binary_str = bin(n).replace("0b", "")  # 去除前缀'0b'
    binary_list = [int(bit) for bit in binary_str]
    return binary_list
 
# 示例
n = 10
print(decimal_to_binary_list(n))  # 输出: [1, 0, 1, 0]


def decimal_to_binary_list(n):
    return np.array(list(map(int, bin(n).replace("0b", ""))), dtype=int)
 
# 示例
n = 358
print(decimal_to_binary_list(n))  # 输出: array([1, 0, 1, 0])